/**
 * Copyright 2020 OPSLI 快速开发平台 https://www.opsli.com
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.opsli.modulars.business.patrolStation.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.opsli.api.wrapper.business.emergency.EmergencyReportModel;
import org.opsli.api.wrapper.business.patrolLocation.PatrolLocationModel;
import org.opsli.api.wrapper.business.patrolStation.PatrolStationModel;
import org.opsli.modulars.business.emergency.mapper.EmergencyReportMapper;
import org.opsli.modulars.business.patrolLocation.mapper.PatrolLocationMapper;
import org.opsli.modulars.business.patrolStation.entity.PatrolStationWeb;
import org.opsli.modulars.business.pipelineStation.entity.PipelineStation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.opsli.core.base.service.impl.CrudServiceImpl;

import org.opsli.modulars.business.patrolStation.entity.PatrolStation;
import org.opsli.modulars.business.patrolStation.service.IPatrolStationService;
import org.opsli.modulars.business.patrolStation.mapper.PatrolStationMapper;

import java.util.List;


/**
 * 巡点管理 Service Impl
 *
 * @author zk
 * @date 2021-09-14 15:53:53
 */
@Service
public class PatrolStationServiceImpl extends CrudServiceImpl<PatrolStationMapper, PatrolStation, PatrolStationModel>
    implements IPatrolStationService {

    @Autowired(required = false)
    private PatrolStationMapper mapper;
    @Autowired(required = false)
    private EmergencyReportMapper emapper;
    @Autowired(required = false)
    private PatrolLocationMapper pmapper;

    @Override
    public List<PatrolStationModel> findList(String devid){
        return mapper.findList(devid);
    }

    @Override
    public List<PatrolStationModel> findListFm(String devid){
        return mapper.findListFm(devid);
    }

    @Override
    public List<EmergencyReportModel> findEList(String devid){
        return emapper.findList(devid);
    }

    @Override
    public List<PatrolLocationModel> findPList(String devid){
        return pmapper.findList(devid);
    }

    @Override
    public List<PatrolLocationModel> findPListHome(String devid){
        return pmapper.findPListHome(devid);
    }

    @Override
    public Page<PatrolStationModel> getMyList(Page<PatrolStationModel> page, PatrolStationModel announcementSendModel,Integer beginSize,Integer endSize){
        return page.setRecords(mapper.getMyList(announcementSendModel,beginSize,endSize));
    }

    @Override
    public List<PatrolStationModel> findListByType(String devid,String type){
        return mapper.findListByType(devid, type);
    }

    @Override
    public List<PatrolStationModel> findListByControlAreaText(String devid, String type, String controlAreaText) {
        return mapper.findListByControlAreaText(devid, type, controlAreaText);
    }

    @Override
    public Integer getSum(String devid,String type){
        return mapper.getSum(devid, type);
    }


    @Override
    public List<PatrolStationModel> findListByTypeAndName(String devid,String type,String stationName){
       return mapper.findListByTypeAndName(devid, type, stationName);
    }

    @Override
    public List<PatrolStationModel> findListQu(String id) {
        return mapper.findListQu(id);
    }

    @Transactional(readOnly = false)
    @Override
    public void updateClear(String id) {

         mapper.updateClear(id);
    }


}
